1. NETWORKING FUNDAMENTALS

SECTION 1 – NETWORKING FUNDAMENTALS

OSI MODEL – OPEN SYSTEM INTERCONNECTION MODEL
Compromise of 7 layers and explain how data transfer takes place.
There are unique protocols at every layer.

97b9d9f50cd5c04a6a93e78a84e4aaa3.png

Each layer enclose data from another layer to facilitate data transmission.
After the data reaches to the destination the reverse process (unpacking) happens.

Each layer is in charge of some kind of processing and each layer only talks to the layers immediately below and above it.

5566780c6c768990fff23255970fcea8.png

Each layer will add or remove control information that it is in charge of.

44a4cfa22ef27074dafe5c2ea67adc4a.png

6c99bb998e0530fb0aa2c16ae393af39.png

Summary of Layer 1 and 2
When a network card receives a stream of bits over the network, it receives the data from the wires (the first layer), then the second layer is responsible for making sense of these 1s and 0s. The second layer first checks the destination MAC address in the frame to make sure the data was intended for that computer. If the destination MAC address matches the MAC address of the network card, it carries on.

Layer 5: Session
The session layer manages the setting up and taking down of the association between two communicating end points, called a connection. A connection is maintained while the two end points are communicating back and forth.
It's in this layer that ports are used and that data is properly directed.

30d5af5373d2e5a5698a3777141441f0.png


IP Address:
[Layer 3, Routing]
Unique Address of a device on a network.

e0dbfcb91a7c08eedf8fef37efc381a7.png

Structure:
They are composed of octets (range 0 to 255).
An octet is a group of eight binary digits (0,1).
[1 = on , 0 = off]
Ex: 192.168.1.5

2f23d08c32107a54f3c35abbf3561502.png

d7dada36a05fcc476d023d1fdd567779.png

c654a17edd211d113a0c61017cb024b8.png

when IP address is combined with a subnet mask,we can calculate the network subnet(LAN) to which the host belongs to.

Subnet masks accompany an IP address and the two values work together.
Netmask tells us how many IP address we can have.
Applying the subnet mask to an IP address splits the address into two parts, an extended network address(network portion of the address), and a host address.
Subnet masks contain two parts: the left side with all mask bits set to 1 (the extended network portion) and the right side with all bits set to 0 (the host portion).

Example- 11111111 11111111 11111111 00000000 = 255.255.255.0
A bit value of 11111111 is equal to 255.
165aba208afea78468a9111de5fea584.png
Position with 255 means we are completely locked out but other than 255 it means we have flexibility.
In the example 24 bits are turned on therefore we have “/24” network here which means We can not change the first 24 bits of the network.

Example in 192.168.134.x , 192.168.134 is fixed and 'X' can be anything from 0 to 255

796603e3650ae354ae15e4220aa44ff8.png

Number of IP Addresses available:
IPv4 = 2^32
IPv6 = 2^128

Types Of IP Addresses:

1. Private IP

fa6a0585256d7a12ba8e32b9be593bf9.png

2. Public IP (Rent/Purchase from ISP)

b463ff4b8ef2d7ca1f65865484256a23.png


Broadcast Address
A subnet has only 254 addresses instead of 256 because two of the address are used up by default on every subnet:the subnet number and broadcast address
Subnet number-first number in subnet range identifies the subnet.Ends with .0
Broadcast address-last address on the subnet.Ends with .255


Mac Addresses
[Layer 2, Switching]

b81473694e44fbb39b4c6c8ca5abbf62.png

Here,
inet = IPv4
inet6 = IPv6
ether = MAC addresses(Physical Address)

Media Access Control Address helps in identifying a unique host on a network.Used by switches to know what device is what.
MAC Address-Layer 2-Data Link Layer
IP Address-Layer 3-Network Layer

It is associated with NIC(Network Interface Card).
They are globally unique.
48 bits length and 12 hexadecimal characters.

First 6 of 12 chars are assigned to different organizations.This part is called OUI (Organizationally Unique Identifier).
First 3 Pairs are identifiers (identify manufacturers)
Ex: 00:0c:29 = VMware Inc.

Router is a layer 2/3 device since it does both routing and switching.


ARP
Address Resolution Protocol-the mechanism that bridges gap between IP and MAC Addresses.
Networking devices and computers keep ARP Tables that match IP Addresses to MAC Addresses.
ARP table is used when data is shared within same subnet.
If destination IP is not in the same subnet the data is forwarded to default gateway.
If there is no MAC in Arp table,the host will send an ARP broadcast on the subnet using subnet's broadcast address to every host - asking who owns the IP Address?


Basic information about network interfaces:
Windows - ipconfig /all
Linux - ifconfig

Contents of ARP cache: arp -a


TCP/IP Ports & Protocols
A port is a way to tag different types of traffic.
Well known ports and protocols:

7f41830cfcdb5ef2389030fdf8c8695b.png


TCP vs UDP
[Layer 4,Transportation Layer]

TCP

UDP

f090d94239be5ff247f38eb473fefb25.png

Protocols Info

If you want to troubleshoot network start from Physical Layer.


One day there will not be enough IP Addresses to support the number of devices.Therefore the idea of private networks and NAT came into existence.
Range of private IP Address:

5fafe8fd8cf078036e6cbf11b8870b4e.png

192.168.1.0 - most common default network assigned to home routers.
Device on private network cannot reach internet unless an intermediary device performs NAT or Network Address Translation.
NAT - swaps one hosts ip address for another ip address.
Multiple private address can share the same public IP address.
Devices on private network behind NAT firewall are hidden from the public internet.

c6af85d8cfc7291306d28fd7d51d1c00.png


Ports
When referring to a network or the Internet, a software or network port is a location where information is sent.